package com.insight.common.api.dto;

import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serializable;

/**
 * 文件上传DTO，封装文件上传相关参数，供 cloud api 使用。
 */
@Data
public class FileUploadDTO implements Serializable {

    private static final long serialVersionUID = -4111953058578954386L;

    /**
     * 上传文件
     */
    private MultipartFile file;

    /**
     * 业务路径
     */
    private String bizPath;

    /**
     * 上传类型
     */
    private String uploadType;

    /**
     * 自定义桶
     */
    private String customBucket;

    public FileUploadDTO(){

    }

    /**
     * 简单上传 构造方法1
     * @param file 上传文件
     * @param bizPath 业务路径
     * @param uploadType 上传类型
     */
    public FileUploadDTO(MultipartFile file,String bizPath,String uploadType){
        this.file = file;
        this.bizPath = bizPath;
        this.uploadType = uploadType;
    }

    /**
     * 指定桶的文件上传 构造方法2
     * @param file 上传文件
     * @param bizPath 业务路径
     * @param uploadType 上传类型
     * @param customBucket 自定义桶
     */
    public FileUploadDTO(MultipartFile file,String bizPath,String uploadType,String customBucket){
        this.file = file;
        this.bizPath = bizPath;
        this.uploadType = uploadType;
        this.customBucket = customBucket;
    }

}
